import request from '@/utils/request'

// 查询充电订单统计列表
export function listStatistics(query) {
  return request({
    url: '/business/statistics/list',
    method: 'get',
    params: query
  })
}

// 查询充电订单统计详细
export function getStatistics(id) {
  return request({
    url: '/business/statistics/' + id,
    method: 'get'
  })
}

// 新增充电订单统计
export function addStatistics(data) {
  return request({
    url: '/business/statistics',
    method: 'post',
    data: data
  })
}

// 修改充电订单统计
export function updateStatistics(data) {
  return request({
    url: '/business/statistics',
    method: 'put',
    data: data
  })
}

// 删除充电订单统计
export function delStatistics(id) {
  return request({
    url: '/business/statistics/' + id,
    method: 'delete'
  })
}

// 获取订单统计信息(按日按月汇总)
export function getChargeOrderStatisticsVo() {
  return request({
    url: '/business/statistics/getChargeOrderStatisticsVo',
    method: 'get'
  })
}

//获取订单金额统计信息柱状图
export function getStatisticsMonthByMonth(data) {
  return request({
    url: '/business/statistics/getStatisticsMonthByMonth',
    method: 'post',
    data: data
  })
}

//获取订单统计信息柱状图
export function getStatisticsByMonth(data) {
  return request({
    url: '/business/statistics/getStatisticsByMonth',
    method: 'post',
    data: data
  })
}

//获取统计代理商相关信息
export function getPlatformAgentStatistics() {
  return request({
    url: '/business/statistics/getPlatformAgentStatistics',
    method: 'post'
  })
}

//通个代理商ID查询场站信息
export function getStationStatisticsByAgentId(agentId) {
  return request({
    url: `/business/statistics/getStationStatisticsByAgentId/${agentId}`,
    method: 'get'
  })
}

//通过场站ID查询设备信息
export function getDeviceStatisticsByStationId(stationId) {
  return request({
    url: `/business/statistics/getDeviceStatisticsByStationId/${stationId}`,
    method: 'get'
  })
}

//用户统计线形图数据
export function getUserStatistics(obj) {
  return request({
    url: `/business/consumer/consumer/statistics/${obj.type}/${obj.num}`,
    method: 'get'
  })
}

//用户统计线饼图数据
export function getUserStatisticsBin() {
  return request({
    url: `/business/consumer/first/charge`,
    method: 'get'
  })
}

//用户消费统计排行榜数据
export function getUserStatisticsFee() {
  return request({
    url: `/business/consumer/max/charge/fee`,
    method: 'get'
  })
}

//用户订单统计排行榜数据
export function getUserStatisticsOrder() {
  return request({
    url: `/business/consumer/max/charge/order`,
    method: 'get'
  })
}
